package com.ruoyi.web.controller.system;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer {

    @Autowired
    private RabbitTemplate rabbitTemplate;


    public void  send(){
        for (int i=0;i<100;i++){
            String msg="序号:"+i;

            System.out.println("pro"+msg);

            rabbitTemplate.convertAndSend("car",msg);
        }
    }
}
